<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/dojo/dojo.js.uncompressed.js"></script>
    <script type="text/javascript" src="application.js"></script>
    <%--
    The reason to use a JSP is that it is very easy to obtain server-side configuration
    information (such as the contextPath) and pass it to the JavaScript environment on the client.
    --%>
    <script type="text/javascript">
        var config = {
            contextPath: '${pageContext.request.contextPath}'
        };
        
       	selectedInstance = function(idToGetInstanceName) {
 	 		var txBox = document.getElementById(idToGetInstanceName);
  			instanceName = txBox.value;
  			txBox.value = "...";
  			_subscriptionMy = cometd.subscribe('instanceName', function(message)
            {
                dojo.byId('body').innerHTML += '<div>Server Says: ' + message.data.greeting + '</div>';
                dojo.byId('body').innerHTML += 'Client ID is ' + message.clientId;
                dojo.byId('body').innerHTML += 'Note ' + message.data.msg;
            });
  			return;
		}
    </script>
</head>
<body>

    <div id="body"></div>
    <span>Select your ticket office</span>
	<input type="text" id = "instance-name"/>
	<a id="instance-choose-existing" href="http://localhost:8080/eva/">Choose exiting</a>
	<input type="button" value="Confirm" id="instance-name-confirm" 
	onclick="selectedInstance('instance-name');"/>

</body>
</html>
